﻿@model  YodaMaster.Models.Table
@using System.Data;

@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<p></p>
<p></p>


        @Html.ActionLink("Add to cart", "../ScheduleCart/AddToCart", 
        new {  id = Model.course_item.number })
   

<p></p>
<p></p>
<h4> General Information about course: @Model.course_item.number  @Model.course_item.name  </h4>
<p></p>
<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.GeneralTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.GeneralTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.GeneralTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.SubGeneralTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.SubGeneralTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.SubGeneralTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

@if(Model.course_item.tests == true )
{
<h3> Tests </h3>
<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.TestsTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.TestsTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.TestsTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

}

@if(Model.course_item.lectureHours > 0)
{
<h3> Lectures </h3>
<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.LecturesTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.LecturesTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.LecturesTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.LecturesTimes.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.LecturesTimes.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.LecturesTimes.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>
}

@if(Model.course_item.tutorialHours > 0)
{
<h3> Tutorials </h3>
<table border ="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.TutorialsTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.TutorialsTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.TutorialsTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.TutorialsTimes.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.TutorialsTimes.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.TutorialsTimes.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>
}

@if(Model.course_item.labHours > 0)
{
<h3> Labs </h3>
<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.LabsTable.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.LabsTable.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.LabsTable.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>

<table border="1"> 
    <thead> 
    <tr> 
    @foreach (System.Data.DataColumn col in Model.LabsTimes.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (System.Data.DataRow row in Model.LabsTimes.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.LabsTimes.Columns)         
        {              
            <td>@row[col.ColumnName]</td> 
        }         
        </tr> 
    }     
    </tbody> 
</table>
}